<?php if (!defined("_INDEX")) { header("Location: /"); die;} ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Смелый взгляд - Панель администратора</title>
	<link href="/files/style/styles.css" rel="stylesheet" type="text/css" />
	<link href="/files/style/admin.css" rel="stylesheet" type="text/css" />
	<link href="/files/js/chat/chat.css" rel="stylesheet" type="text/css" />
	<link href="/files/js/jquery.ui/css/ui-lightness/jquery.ui.css" rel="stylesheet" type="text/css" />
	<link href="/files/js/fancybox/jquery.fancybox-1.3.4.css" rel="stylesheet" type="text/css" />
	<link rel="icon" type="image/png" href="/favicon.png" />
	<script type="text/javascript" src="/files/js/jquery.js"></script>	
	<script type="text/javascript" src="/files/js/admin.js"></script>	
	<!--<script type="text/javascript" src="/files/js/chat/chat.js"></script>-->
	<script type="text/javascript" src="/files/js/jquery.scrollTo-1.4.2-min.js"></script>
	<script type="text/javascript" src="/files/js/jquery.ui/js/jquery.ui.min.js"></script>	
	<script type="text/javascript" src="/files/js/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
	<script type="text/javascript" src="/files/js/fancybox/jquery.easing-1.3.pack.js"></script>
	<script type="text/javascript" src="/files/js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
</head>
<body>
	<div id='center'>
		<div id='header'>
			<div id='header_left'><div>Администрирование</div></div>
			<div id='header_center'></div>
			<div id='header_right'>
				<div class='header_text'>
					<div class='header_sname'><?php echo $user->getSName();?></div>
					<div class='header_name'><?php echo $user->getName()." ".$user->getTName(); ?></div>
					<div class='header_links'><?php if ($user->getUserId() == 12 || $user->getUserId() == 1) echo "<a href='/admin/report'>отчет</a> | "; ?><a href='/'>на сайт</a> | <a href='/auth/logout'>выход</a></div>
				</div>
			</div>
		</div>

		<div class="cabinet_menu">
			<a class="mbutton <?php if($route->getAction()=="statistics") echo "mbactive"?>" href="/admin/statistics/coordinators"><?php echo ($route->getAdminPlace() == "report") ? "Отчет" : "Статистика"; ?></a>
			<a class="mbutton <?php if($route->getAction()=="content") echo "mbactive"?>" href="/admin/content">Новости</a>
			<a class="mbutton <?php if($route->getAction()=="rumors") echo "mbactive"?>" href="/admin/rumors">Слухи</a>
			<a class="mbutton <?php if($route->getAction()=="users") echo "mbactive"?>" href="/admin/users/short">Пользователи</a>
			<a class="mbutton <?php if($route->getAction()=="moder") echo "mbactive"?>" href="/admin/moder">Модерация</a>
			<a class="mbutton" href="/cabinet">Личный кабинет</a>
			<a class="mbutton <?php	if($route->getAction()=="messages") echo "mbactive"?>" href="/admin/messages">Сообщения<?php
				$unread_messages = $db->getCell("select count(`message_id`) from `messages` where `recipient_id` = '".$user->getUserId()."' and `read` = '0' and `show_recipient` = '1'");
				if ($unread_messages)
					echo " ($unread_messages)";
			?></a>
		</div>